var http = require('http');
// 搭建http服务器
var server = http.createServer();
// 监听请求
server.on('request', function (req, res) {
    console.log('已发送请求');
    console.log(req.headers);
    console.log(req.url);
    console.log(req.body);

    res.setHeader('Content-Type', 'text/html;charset=utf-8');
    res.write('test1');
    res.write('test2');
    // 结束输出
    res.end('Hello World');
});
// 监听端口号
server.listen(8080, function () {
    console.log('listen successfully !');
});
